class Solution {
public:
    int missingNumber(int* nums, int numsSize)
    {
        int i = 0;
        int miss = 0;
        for (i = 0; i < numsSize; i++)
        {
            miss ^= nums[i];
        }
        for (i = 0; i <= numsSize; i++)
        {
            miss ^= i;
        }
        return miss;
    }
}; 